package com.llp.javaweb.util;

import com.llp.javaweb.pojo.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @author llp
 * {@code @date} 2022年11月02日17:53
 */

public class CheckIsLogin {
    public static boolean IsLogin(HttpServletRequest request, HttpServletResponse response) throws IOException {
        HttpSession session = request.getSession();
        User user = (User)session.getAttribute("user");
        if (user==null)
        {

            return false;
        }
        return true;

    }
}
